home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Begin VB.Form frmLock BackColor = &H80000001& BorderStyle = 0 'None ClientHeight = 4620 ClientLeft = 0 ClientTop = 0 ClientWidth = 7035 ClipControls = 0 'False ControlBox = 0 'False LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False Moveable = 0 'False ScaleHeight = 4620 ScaleWidth = 7035 ShowInTaskbar = 0 'False StartUpPosition = 2 'CenterScreen WindowState = 2 'Maximized Begin VB.PictureBox picDialog BackColor = &H00C0C0C0& BorderStyle = 0 'None Height = 1815 Left = 720 ScaleHeight = 1815 ScaleWidth = 4095 TabIndex = 0 Top = 240 Width = 4095 Begin VB.CommandButton cmdOk Caption = "&Ok" Height = 615 Left = 1200 TabIndex = 3 Top = 1080 Width = 1695 End Begin VB.TextBox txtPass Height = 360 IMEMode = 3 'DISABLE Left = 120 PasswordChar = "*" TabIndex = 2 Top = 600 Width = 3855 End Begin VB.Timer tmrLockedFlash Interval = 500 Left = 0 Top = 0 End Begin VB.Label lblLocked Alignment = 2 'Center BackColor = &H00C0C0C0& Caption = "COMPUTER LOCKED" BeginProperty Font Name = "Arial Black" Size = 14.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 120 TabIndex = 1 Top = 120 Width = 3855 End Begin VB.Image imgFake3D Height = 1815 Left = 0 Picture = "frmLock.frx":0000 Stretch = -1 'True Top = 0 Width = 4095 End End Attribute VB_Name = "frmLock" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False 'required for disabling keys Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long Private Const SPI_SCREENSAVERRUNNING = 97 Private Sub cmdOk_Click() 'check if password is correct If txtPass.Text = frmPass.txtPass(0).Text Then 'if correct password, exit 'unload forms from memory Unload frmLock Unload frmPass 'end program End If End Sub Private Sub Form_Load() 'place the unlock dialog half way across screen, 'a third of the way down picDialog.Top = (Screen.Height - picDialog.Height) / 3 picDialog.Left = (Screen.Width - picDialog.Width) / 2 'trick computer into thinking a passworded screensaver 'is running - disables Alt+Tab, Ctrl-Alt-Del, Win9x keys 'etc. Dim Ret As Long Dim pOld As Boolean Ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0) End Sub Private Sub Form_Unload(Cancel As Integer) 'when program closes, re-enable keys Dim Ret As Long Dim pOld As Boolean Ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0) End Sub Private Sub tmrLockedFlash_Timer() 'if colour is red, change to black If lblLocked.ForeColor = &HFF& Then lblLocked.ForeColor = &H80000012 'exit sub (if reaches next if, it will change back) Exit Sub End If 'if colour is black, change to red If lblLocked.ForeColor = &H80000012 Then lblLocked.ForeColor = &HFF& Exit Sub End If End Sub